home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / internet / irc_i_dodatki / dwarfx / dwarf24.lha / dwarfinsult.amirx < prev    next >
Text File  |  1980-12-25  |  5KB  |  30 lines

  1. /* $VER: DWaRFiNSULT v¹·¹
  2. \\ Originally coded by CoolWave & Beeker
  3. // Permission for inclusion and editting for DWaRFx given by Beeker.
  4. \\ USAGE: /rx DWaRFiNSULT [Options] [Nick]
  5. // Makes a random insult sentance for [Nick] and sends on current channel.
  6. \\ If [Nick] is absent, then a randomly picked nick on the current channel
  7. // will be randomly insulted!
  8. \\ Options:
  9. //            NOTE: Each option must be seperated by a space!
  10. \\
  11. //  /W<delay> will pause inbetween output for that many vblanks (second/50).
  12. \\  /S will speak the insult on clients with a rexx speech script turned on.
  13. //  /#<number_of_insults> will send that many random insults (1-25).
  14. \\  /F<insults_file_name> will use the insults from the file named instead
  15. //                        of `Amirc:Rexx/DWaRFiNSULT.tXt' .
  16. \\  Alias  = /rx DWaRFiNSULT.AmIRX %p" - not needed with MUI GUI version
  17. \\
  18. */
  19.  
  20. /* Compressed with CompressRexx v2.1, (C) 1993-96 Robert Hofmann */
  21. Options Results;Parse Arg args;If Left(Address(),6)~="AMIRC." Then Exit;"GetMyNick";mynick=result;"GetUsers";users=Compress(result,"@");"GetChannel";channel=result;speech="";insults=1;wait=0;fname="AmIRC:rexx/DWaRFx/DWaRFiNSULT.tXt";pause=0;Call Setclip('DFxTIME',Time());Do While Substr(args,1,1)='/';type = Substr(Upper(args),2,1);Select;When type='S' Then speech="@ ";When type='#' Then insults=Word(Delstr(args,1,2),1);When type='W' Then wait=Word(Delstr(args,1,2),1);When type='F' Then fname=Word(Delstr(args,1,2),1);End;args=Delword(args,1,1);End;If insults<1|insults>25 Then insults=1;If wait<0|wait>3000 Then wait=15;ruser=Word(args,Words(args));Call Random(,,Time(S));If ~Show('L','rexxsupport.library') Then Do;If ~Addlib('rexxsupport.library',0,-30,0)&wait~=0 Then Call ERR(4);pause=1;End;Else pause=1;If ruser="" Then Do;users=DelWord(users,Find(users,mynick),1);If wait=0&pause=1 Then wait=40;End;Else users=ruser;If upper(users) ="GåZ" Then do;"say /MSG "channel" "d2c(2)"Hey Im sick
  22.  of it..."d2c(2)
  23. "say /MSG "channel" "d2c(2)"Im gonna pick some poor Smegga to insult...";"say /MSG "channel" "d2c(2)"3.........";"say /MSG "channel" "d2c(2)"2......";"say /MSG "channel" "d2c(2)"1...";"say /MSG "channel" "d2c(2)"«|DWaRF_iNSULT|» - lets just hope its that smeg head Rimmer!";"say /MSG "channel" "d2c(2)"GåZ is a being of higher intelligence and finesse, I worship his every action...";"say /MSG "channel" "d2c(2)"I have also learned my lesson and realised that GåZ is the author of DWaRFx and cannot be judged.";"say /Op GåZ";"say /Kick "mynick" DWaRFx has punished you....";exit;end;If Open("insults",fname) Then Do;Call GETLINES();Call GETWORDS();If ruser="" Then Do;If pause=1 Then Call Delay(wait);"Say /MSG "channel" "d2c(2)"Hey Im sick of it..."d2c(2);If pause=1 Then Call Delay(wait);"Say /MSG "channel" "d2c(2)"Im gonna pick some poor Smegga to insult...";If pause=1 Then Call Delay(wait);"Say /MSG "channel" "d2c(2)"3.........";If pause=1 Then Call Delay(wait);"Say /MSG "channel" "d2c(2
  24. )"2......"
  25. If pause=1 Then Call Delay(wait);"Say /MSG "channel" "d2c(2)"1...";If pause=1 Then Call Delay(wait);"Say /MSG "channel" "d2c(2)"«|DWaRF_iNSULT|» - lets just hope its that smeg head Rimmer!";End;Do count=1 To insults;If wait>0 Then Call Delay(wait);"Say /MSG "channel" "speech||" "d2c(2)" "mess.count;End;Exit;End;Else Call ERR(1);GETLINES:;temp="";scan.=0;Do Until Eof("insults")|Left(temp,7)="[LINES:";temp=Readln("insults");End;lines=Substr(temp,8,Pos("]",temp,8)-8);If lines<0 Then Call ERR(2);gotlines=0;Do Until Eof("insults")|gotlines=lines;gotlines=gotlines+1;line.gotlines=Readln("insults");End;If gotlines<lines Then Call ERR(2);Do count=1 To insults;temp=Random(1,lines);mess.count=line.temp;found=Pos("%",mess.count);Do While found~=0;temp=c2d(Upper(Substr(mess.count,found+1,1)))-64;scan.temp=scan.temp+1;found=Pos("%",mess.count,found+1);End;End;Return;GETWORDS:;Do count=1 To 8;If scan.count=0 Then Iterate;temp="";found="["d2c(count+64)":";Do Until Eof("insults")|Left(temp,3)=found;t
  26. emp=Readln("insults")
  27. End;lines=Substr(temp,4,Pos("]",temp,4)-4);If lines<0 Then Call ERR(2);gotlines=0;Do Until Eof("insults")|gotlines=lines;gotlines=gotlines+1;line.gotlines=Readln("insults");End;If gotlines<lines Then Call ERR(2);Do loop=1 To scan.count;found=Random(1,lines);scan.count.loop=line.found;End;End;Do loop=1 To scan.21;scan.21.loop=Word(users,Random(1,Words(users)));End;Do loop=1 To insults;found=Pos("%",mess.loop);Do While found~=0;temp=c2d(Upper(Substr(mess.loop,found+1,1)))-64;count=scan.temp;scan.temp=scan.temp-1;mess.loop=Delstr(Insert(scan.temp.count,mess.loop,found+1),found,2);found=Pos("%",mess.loop,found);End;End;Return;ERR:;Parse Arg errno;temp="P="d2c(27)"x«Whoops!» "d2c(2)"Error: "d2c(2);Select;When errno=1 Then "Echo "temp"Couldn't find file `"fname"'!";When errno=2 Then "Echo "temp"`"fname"' is a corrupted insults file!";When errno=3 Then "Echo "temp"No other smeghead on channel to insult!";When errno=4 Then "Echo "temp"Unable to open rexxsupport.library!";End;Call Close("insul
  28. ts");Exit;Return
  29. /* Original script: 138 lines, 5072 bytes */
  30.